package com.common.domain.dto;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author liuxuhuang
 * @date 2023年04月21日 11:03
 * @desc 获取水电费记录查询条件
 */
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode
@ToString
public class WaterElectricityQueryDTO implements Serializable {
    /**
     * 楼宇id
     */
    private long buildId;
    /**
     * 时间范围
     */
    private List<String> dateRange;

    private Integer pageNum;

    private Integer pageSize;

    public long getBuildId() {
        return buildId;
    }

    public void setBuildId(long buildId) {
        this.buildId = buildId;
    }

    public List<String> getDateRange() {
        return dateRange;
    }

    public void setDateRange(List<String> dateRange) {
        this.dateRange = dateRange;
    }

    public Integer getPageNum() {
        if (Objects.isNull(pageNum) || StringUtils.isBlank(pageNum.toString())) {
            return 1;
        }
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        if (Objects.isNull(pageSize) || StringUtils.isBlank(pageSize.toString())) {
            return 10;
        }
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
}
